﻿@model S4Store.Models.Decorate.IndexModel
@{
    Layout = null;
    ViewBag.Title = "Index";


    S4Store.Models.Chart.Column ChartModel = new S4Store.Models.Chart.Column();
    ChartModel.Name = "销售顾问精品装潢KPI";
    ChartModel.YAxis = "比率(%)";
    foreach (var m in Model.Reports)
    {
        ChartModel.XAxis.Add(m.Seller.Name+"(交车："+m.JCS+")");
    }
    S4Store.Models.Chart.ChartSeries series1 = new S4Store.Models.Chart.ChartSeries();
    series1.Name = "目标套餐车销售率";
    foreach (var m in Model.Reports)
    {
        series1.Data.Add(Model.SellerPerformanceStandard.TCCXSLV);
    }
    ChartModel.Serieses.Add(series1);

    S4Store.Models.Chart.ChartSeries series2 = new S4Store.Models.Chart.ChartSeries();
    series2.Name = "实际套餐车销售率";
    foreach (var m in Model.Reports)
    {
        series2.Data.Add(m.TCCXSLV);
    }
    ChartModel.Serieses.Add(series2);
    
    S4Store.Models.Chart.ChartSeries series3 = new S4Store.Models.Chart.ChartSeries();
    series3.Name = "目标装潢车销售率";
    foreach (var m in Model.Reports)
    {
        series3.Data.Add(Model.SellerPerformanceStandard.YXZHCXSLV);
    }
    ChartModel.Serieses.Add(series3);

    S4Store.Models.Chart.ChartSeries series4 = new S4Store.Models.Chart.ChartSeries();
    series4.Name = "实际装潢车销售率";
    foreach (var m in Model.Reports)
    {
        series4.Data.Add(m.YXZHCXSLV);
    }
    ChartModel.Serieses.Add(series4);



    S4Store.Models.Chart.Column ChartModel2 = new S4Store.Models.Chart.Column();
    ChartModel2.Name = "销售顾问精品装潢KPI";
    ChartModel2.YAxis = "比率(%)";
    foreach (var m in Model.TelSellerReports)
    {
        ChartModel2.XAxis.Add(m.Seller.Name + "(交车：" + m.JCS + ")");
    }
    series1 = new S4Store.Models.Chart.ChartSeries();
    series1.Name = "目标套餐车销售率";
    foreach (var m in Model.TelSellerReports)
    {
        series1.Data.Add(Model.SellerPerformanceStandard.TCCXSLV);
    }
    ChartModel2.Serieses.Add(series1);

    series2 = new S4Store.Models.Chart.ChartSeries();
    series2.Name = "实际套餐车销售率";
    foreach (var m in Model.TelSellerReports)
    {
        series2.Data.Add(m.TCCXSLV);
    }
    ChartModel2.Serieses.Add(series2);

    series3 = new S4Store.Models.Chart.ChartSeries();
    series3.Name = "目标装潢车销售率";
    foreach (var m in Model.TelSellerReports)
    {
        series3.Data.Add(Model.SellerPerformanceStandard.YXZHCXSLV);
    }
    ChartModel2.Serieses.Add(series3);

    series4 = new S4Store.Models.Chart.ChartSeries();
    series4.Name = "实际装潢车销售率";
    foreach (var m in Model.TelSellerReports)
    {
        series4.Data.Add(m.YXZHCXSLV);
    }
    ChartModel2.Serieses.Add(series4);
}
<script type="text/javascript">
    $(function () {
        var $c = $("#myContentArea");
        var count = $("#myContentArea").find("table td").has(".value").size();
        var right = parseInt($("#right").css("width").replace("px", "")) - 20;
        if (count * 190 + 70 >= right) {
            $c.width(count * 190 + 70);
        }
    });
</script>
<div style="height: 100%; width: 100%; overflow: auto;">
<div id="myContentArea" style="overflow:hidden">
@Html.Action("ReportBar", "Common", Model.BarModel)
<div style="position:relative; width:100%">     
<div class="tabs" currentIndex="0" eventType="click">
	<div class="tabsHeader">
		<div class="tabsHeaderContent">
			<ul>
				<li><a href="javascript:;"><span>现场销售</span></a></li>
				<li><a href="javascript:;"><span>电话销售</span></a></li>
			</ul>
		</div>
	</div>
	<div class="tabsContent" >
		<div>
        @Html.Partial("../Chart/Column", ChartModel)
        <div style=" margin-left:70px; overflow:hidden">
 <table style="width:100%">
            <tr>
@foreach (var m in Model.Reports)
{
    var target=m.SaleTarget;
    var tccmb=target*Model.SellerPerformanceStandard.TCCXSLV/100;
    var zhcmb = target * Model.SellerPerformanceStandard.YXZHCXSLV / 100;
    var sjtcc=m.TCCXSSL;
    var sjzhc=m.YXZHCXSSL;
    
                <td align="center" width="30">
    @if (sjtcc < tccmb)
    {
                    <a class="specialRed"  href="@Url.Action("PersonDetail", new { Month = Model.BarModel.Month.ToString("yyyy-MM-dd"),SearchSellerId=m.Seller.Id })" target="navtab" title="@(m.Seller.Name)精品装潢过程KPI">
                        <div class="value"></div>
                        <div class="rt">套餐车差：@( (tccmb - sjtcc).toInt(3))</div>
                        <div class="rb">装潢车差：@((zhcmb - sjzhc).toInt(3))</div>
                    </a>
    }
    else
    {
        <a class="specialGreen"  href="@Url.Action("PersonDetail", new { Month = Model.BarModel.Month.ToString("yyyy-MM-dd"), SearchSellerId = m.Seller.Id })" target="navtab" title="@(m.Seller.Name)精品装潢过程KPI">
                        <div class="value"></div>
                        <div class="rt">套餐车差：@( (tccmb - sjtcc).toInt(3))</div>
                        <div class="rb">装潢车差：@((zhcmb - sjzhc).toInt(3))</div>
                    </a>
    }
    </td>
}
            </tr>
        </table>
</div> 
		</div>
		<div>
        @Html.Partial("../Chart/Column", ChartModel2)
        <div style=" margin-left:70px; overflow:hidden">
 <table style="width:100%">
            <tr>
@foreach (var m in Model.TelSellerReports)
{
    var target=m.SaleTarget;
    var tccmb = target * Model.SellerPerformanceStandard.TCCXSLV / 100;
    var zhcmb = target * Model.SellerPerformanceStandard.YXZHCXSLV / 100;
    var sjtcc=m.TCCXSSL;
    var sjzhc=m.YXZHCXSSL;
    
                <td align="center" width="30">
    @if (sjtcc < tccmb)
    {
                    <a class="specialRed"  href="@Url.Action("PersonDetail", new { Month = Model.BarModel.Month.ToString("yyyy-MM-dd"),SearchSellerId=m.Seller.Id })" target="navtab" title="@(m.Seller.Name)精品装潢过程KPI">
                        <div class="value"></div>
                        <div class="rt">套餐车差：@( (int)(tccmb - sjtcc))</div>
                        <div class="rb">装潢车差：@((int)(zhcmb - sjzhc))</div>
                    </a>
    }
    else
    {
        <a class="specialGreen"  href="@Url.Action("PersonDetail", new { Month = Model.BarModel.Month.ToString("yyyy-MM-dd"), SearchSellerId = m.Seller.Id })" target="navtab" title="@(m.Seller.Name)精品装潢过程KPI">
                        <div class="value"></div>
                        <div class="rt">套餐车差：@( (int)(tccmb - sjtcc))</div>
                        <div class="rb">装潢车差：@((int)(zhcmb - sjzhc))</div>
                    </a>
    }
    </td>
}
            </tr>
        </table>
</div>
		</div>
	</div>
	<div class="tabsFooter">
		<div class="tabsFooterContent"></div>
	</div>
</div>
     
        
</div>
</div>
</div>

